package com.zx.mes.test.hyl.model.decorate;

/**
 * 装饰对象(与适配器模式非常相似)
 * @author hyl
 * @date 2018-3-29
 */
public class NewPerson implements Person{

    private OldPerson oldPerson;

    public NewPerson(OldPerson oldPerson){
        this.oldPerson = oldPerson;
    }

    public void eat() {
        System.out.println("生火");
        System.out.println("做饭");
        oldPerson.eat();
        System.out.println("刷碗");
    }
}
